import wxRequest from '@/utils/wxRequest'
import request from '@/utils/request'

// for wechat notifications
export function sendNotificationAPI (fansId, content) {
  return wxRequest({
    url: '/api/send-message/',
    method: 'post',
    data: {
      fans_id: fansId,
      content
    }
  })
}

// for website notifications
export function clearNotifyAPI () {
  return request({
    url: '/user/notifications/clear-unread-notifications/',
    method: 'patch',
  })
}

export function getNotifyListAPI (nextPage = 1) {
  const params = {
    page: nextPage
  }

  return request({
    url: '/user/notifications/',
    method: 'get',
    params: params
  })
}
export function getNotifyDetailAPI (pk) {
  return request({
    url: '/user/notifications/' + pk + '/',
    method: 'get'
  })
}
